#include <iostream>
//#include <loadmesh.hpp>


#include <life/lifefilters/geotool.hpp>
using namespace Life;

int main(int argc, char ** argv)
{
  GeoTool::Node x_centre2(0.5,0.5);
  GeoTool::Node x_bord2(0.7,0.5);
  GeoTool::Circle C2(0.04,"uncercle",x_centre2,x_bord2);
  C2.setMarker(_type="line",_name="Interface",_marker1=true);
  C2.setMarker(_type="surface",_name="Omega2",_marker1=true);
  std::cout<< C2.geoStr();

  GeoTool::Node x1(-1,-1);
  GeoTool::Node x2(0.2,1);
  GeoTool::Rectangle R1(0.08,"LEFT",x1,x2);
  R1.setMarker(_type="line",_name="Interface",_marker2=true);
  R1.setMarker(_type="line",_name="Bord",_marker1=true,_marker3=true,_marker4=true);
  R1.setMarker(_type="surface",_name="Omega1",_marker1=true);
  std::cout<<R1.geoStr();

  GeoTool::Node x3(0.2,-1);
  GeoTool::Node x4(1,1);
  GeoTool::Rectangle R2(0.05,"ALLRIGHT",x3,x4);
  R2.setMarker(_type="line",_name="Interface",_marker4=true);
  R2.setMarker(_type="line",_name="Bord",_marker1=true,_marker2=true,_marker3=true);
  R2.setMarker(_type="surface",_name="Omega2",_marker1=true);

  std::cout<<(R1+R2).geoStr();

  //---------------------------------------------------------------------//
  //---------------------------------------------------------------------//

  std::cout<<"\n\n(R-C)+Q\n";

  GeoTool::Node y1(0,0);
  GeoTool::Node y2(1,1);
  GeoTool::Rectangle R(0.04,"RIGHT",y1,y2);
  //R.setMarker(_type="line",_name="Bord",_marker1=true,_marker2=true,_marker3=true,_marker4=true);
  R.setMarker(_type="line",_name="Bord",_markerAll=true);
  R.setMarker(_type="surface",_name="Omega1",_marker1=true);
  
  GeoTool::Node x_centre(0.5,0.5);
  GeoTool::Node x_bord(0.7,0.5);
  GeoTool::Circle C(0.04,"uncercle",x_centre,x_bord);
  C.setMarker(_type="line",_name="Interface",_marker1=true);
  C.setMarker(_type="surface",_name="Omega2",_marker1=true);

  GeoTool::Circle Q(0.04,"fdkjfcercle",x_centre,x_bord);
  Q.setMarker(_type="line",_name="Interface",_marker1=true);
  Q.setMarker(_type="surface",_name="Omega3",_marker1=true);


  std::cout<< ((R-C)+Q).geoStr();

  //---------------------------------------------------------------------//
  //---------------------------------------------------------------------//

  std::cout<< C.geoStr();
  //std::cout<< "Physical Surface(\"Omega2\") = {1}\n";


  GeoTool::Node a1(0,0,0);
  GeoTool::Node a2(1,0,0);
  GeoTool::Node a3(1,1,0);std::cout<<"\nol"<<a3.getNode()(2);
  GeoTool::Node a4(0,1,0);
  GeoTool::Node a5(0,0,1);
  GeoTool::Node a6(1,0,1);
  GeoTool::Node a7(1,1,1);
  GeoTool::Node a8(0,1,1);
  GeoTool::Hexaedre H(0.1,"hexa",a1,a2,a3,a4,a5,a6,a7,a8);
  //  H.setMarker(_type="line",_name="Edge",_markerAll=true);
  H.setMarker(_type="surface",_name="Bound1",_marker1=true); 
  H.setMarker(_type="surface",_name="Boundary",_marker2=true,_marker3=true,_marker4=true,_marker5=true,_marker6=true);
  std::cout <<"\n\n" << H.geoStr();


  /*
  GeoTool::Node xx1(0,0);
  GeoTool::Node xx2(1,1);
  GeoTool::Rectangle RR1(0.05,"LEFT",xx1,xx2);
  // RR1.setMarker(_type="line",_name="Bord",_markerAll=true);
  // RR1.setMarker(_type="surface",_name="Omega1",_marker1=true);
  GeoTool::Node xx_centre(0.5,0.5);
  GeoTool::Node xx_bord(0.8,0.5);
  GeoTool::Circle CC(0.04,"uncercle",xx_centre,xx_bord);
  CC.setMarker(_type="line",_name="Interface",_marker1=true);
  CC.setMarker(_type="surface",_name="Omega2",_marker1=true);
    //GeoTool::GeoGMSHTool(RR1+CC);
  std::cout<<(RR1-CC).geoStr();
  */


  GeoTool::Node x21(0,0);
  GeoTool::Node x22(1,1);
  GeoTool::Rectangle RR(0.1,"RIGHT",x21,x22);
  RR.setMarker(_type="line",_name="Bord",_marker1=true,_marker2=true,_marker3=true,_marker4=true);
  RR.setMarker(_type="surface",_name="Omega3",_marker1=true);

  GeoTool::Node xxx_centre(0.5,0.5);
  GeoTool::Node xxx_bord(0.7,0.5);
  GeoTool::Circle CC(0.2,"DISQUE",xxx_centre,xxx_bord);
  CC.setMarker(_type="line",_name="Interface",_marker1=true);
  //C.setMarker(_type="surface",_name="Omega2",_marker1=true);

  GeoTool::Node xxx2_centre(0.5,0.5);
  GeoTool::Node xxx2_bord(0.7,0.5);
  GeoTool::Circle CC2(0.3,"DISQUE",xxx2_centre,xxx2_bord);
  CC2.setMarker(_type="line",_name="Interface",_marker1=true);
  CC2.setMarker(_type="surface",_name="Omega4",_marker1=true);


  std::cout<<(RR-CC).geoStr();
  std::cout<<"\n\n"<<(CC2).geoStr();


  //GeoTool::Node xxx2_centre(0.5,0.5);
  //GeoTool::Node xxx2_bord(0.7,0.5);
  GeoTool::Special_1a S1a(0.3,"spec",xxx2_centre);
  S1a.setMarker(_type="line",_name="inner",_marker1=true);
  S1a.setMarker(_type="line",_name="outer",_marker2=true);
  S1a.setMarker(_type="line",_name="boundLeft",_marker3=true);
  S1a.setMarker(_type="line",_name="boundRight",_marker4=true);
  S1a.setMarker(_type="surface",_name="membrane",_marker1=true);

  std::cout<<"\n\n"<<S1a.geoStr();
  
  GeoTool::Special_1b S1b(0.3,"spec_1b",xxx2_centre);
  S1b.setMarker(_type="line",_name="interface",_marker1=true);
  S1b.setMarker(_type="line",_name="in",_marker2=true);
  S1b.setMarker(_type="line",_name="out",_marker3=true);
  S1b.setMarker(_type="surface",_name="fluide",_marker1=true);

  std::cout<<"\n\n"<<S1b.geoStr();

  std::cout<<"\n\n"<<(S1a+S1b).geoStr();




  GeoTool::Node y_centre(0.0,0.0);
  GeoTool::Node y_bord(0.3,0.0);
  GeoTool::Circle __circ1(0.1,"cerclein",y_centre,y_bord);
  __circ1.setMarker(_type="line",_name="inner",_marker1=true);
  __circ1.setMarker(_type="surface",_name="particule",_marker1=true);
    
  GeoTool::Node y_bord2(0.3+0.1,0.0);
  GeoTool::Circle __circ2(0.1,"cercleout",y_centre,y_bord2);
  __circ2.setMarker(_type="line",_name="outer",_marker1=true);
  __circ2.setMarker(_type="surface",_name="around_part",_marker1=true);

  std::cout<<"\n\n"<<(__circ2-__circ1).geoStr();





  return 0;


}
